package com.sztx.worker_monitor.web.model;

import com.sztx.se.core.quartz.config.JobRunningInfo;
import com.sztx.se.core.quartz.config.QuartzParameter;

public class QuartzDetailModel extends QuartzModel{

	/**
	 * 唯一标示
	 */
	private String id ="";

	
	/**
	 * 任务的具体类名, 可以是全路径的java类, 也可以是被spring管理的简单类名
	 */
	private String fullJobClassName;
	
	/**
	 * 执行者标示
	 */
	private String instanceName="";

	/**
	 * 机器IP地址
	 */
	private String ip="";

	/**
	 * 机器名称
	 */
	private String hostName="";

	/**
	 * 执行开始时间
	 */
	private String startTime="";

	/**
	 * 执行结束时间
	 */
	private String endTime="";

	/**
	 * 处理时长(单位:毫秒)
	 */
	private long cost=0;

	/**
	 * 执行结果
	 */
	private String result="";

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getInstanceName() {
		return instanceName;
	}

	public void setInstanceName(String instanceName) {
		this.instanceName = instanceName;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getHostName() {
		return hostName;
	}

	public void setHostName(String hostName) {
		this.hostName = hostName;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public long getCost() {
		return cost;
	}

	public void setCost(long cost) {
		this.cost = cost;
	}

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public QuartzDetailModel() {
		super();
	}
	

	public String getFullJobClassName() {
		return fullJobClassName;
	}

	public void setFullJobClassName(String fullJobClassName) {
		this.fullJobClassName = fullJobClassName;
	}

	public QuartzDetailModel(QuartzParameter quartzParameter, JobRunningInfo jobRunningInfo) {
		super(quartzParameter);
		if(jobRunningInfo == null ) return ;
		this.id 		= jobRunningInfo.getId();
		this.instanceName = jobRunningInfo.getInstanceName();
		this.ip 		= jobRunningInfo.getIp();
		this.hostName 	= jobRunningInfo.getHostName();
		this.startTime 	= jobRunningInfo.getStartTime();
		this.endTime 	= jobRunningInfo.getEndTime();
		this.cost 		= jobRunningInfo.getCost();
		this.result 	= jobRunningInfo.getResult();
		this.fullJobClassName 	= jobRunningInfo.getJobClassName();
		
	}

	public QuartzDetailModel(String id, String instanceName, String ip,
			String hostName, String startTime, String endTime, long cost,
			String result, String fullJobClassName) {
		super();
		this.id = id;
		this.instanceName = instanceName;
		this.ip = ip;
		this.hostName = hostName;
		this.startTime = startTime;
		this.endTime = endTime;
		this.cost = cost;
		this.result = result;
		this.fullJobClassName 	= fullJobClassName;
	}
	
	
	
	
	
}
